﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1.Base
{
    public class NonBorderMove
    {
        protected Form Frm;

         
        public NonBorderMove(Form frm)
        {
            Frm = frm;

        }

        protected void WndProc(ref Message m)
        {
            //const int WM_NCHITTEST = 0x84;
            //const int HTCLIENT = 0x01;
            //const int HTCAPTION = 0x02;
            //if (m.Msg == WM_NCHITTEST)
            //{
            //    this.DefWndProc(ref m);
            //    if (m.Result.ToInt32() == HTCLIENT)
            //        m.Result = new IntPtr(HTCAPTION);
            //    else
            //        base.WndProc(ref m);
            //}
            //else
            //{
            //    base.WndProc(ref m);
            //}
        }

        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            //const int WM_NCLBUTTONDOWN = 0x00A1;
            //const int WM_NCHITTEST = 0x84;
            //const int HT_CAPTION = 0x2;
            //const int HT_CLIENT = 0x1;
            ////pictureBox1.Capture = false;
            //Message msg = Message.Create(Handle, WM_NCLBUTTONDOWN, (IntPtr)HT_CAPTION, IntPtr.Zero);
            //WndProc(ref msg);
        }


    }
}
